import unittest
import HTMLTestRunner
import os
import time

report_path = r'C:\Users\15460\Desktop\code\wolf-battle-sky-code-warehouse\aotoframe\report'
html_report_filename = 'front_home ' + time.strftime('%Y-%m-%d-%H-%M-%S') + '-HTMLReport.html'
html_report_path = os.path.join(report_path, html_report_filename)

loader = unittest.defaultTestLoader.discover('../case/front', pattern='*home*')
with open(html_report_path, 'wb') as f:
    runner = HTMLTestRunner.HTMLTestRunner(
        title='浏览商品',
        description='浏览商品自动化测试报告',
        stream=f,
        verbosity=2
    )
    runner.run(loader)
